<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8">
	<title>新闻添加</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="/layui/css/layui.css" media="all" />
	<!--<link rel="stylesheet" href="/css/font_eolqem241z66flxr.css" media="all" />-->
	<link rel="stylesheet" href="/js/kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="/js/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="/js/kindeditor/kindeditor-all.js"></script>
	<script charset="utf-8" src="/js/kindeditor/lang/zh-CN.js"></script>
	<script charset="utf-8" src="/js/kindeditor/plugins/code/prettify.js"></script>
	<style>.layui-input-inline img{width:100%;height:auto}</style>
</head>
<body class="childrenBody">
	<form class="layui-form" style="width:80%;">
		<input type="hidden" name="messageId" th:value="${message.messageId}">
		<input type="hidden" name="categoryId" th:value="${message.categoryId}">

		<div class="layui-form-item">
			<label class="layui-form-label">信息名称</label>
			<div class="layui-input-block">
				<input type="text" th:value="${message.name}" class="layui-input" name="name" id="name" lay-verify="required" placeholder="请输入名称">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">排序</label>
			<div class="layui-input-inline">
				<input type="number" class="layui-input" name="sort" th:value="${message.sort}">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">是否推荐</label>
			<div class="layui-input-inline">
				<input type="radio" name="isRecommend" value="0" title="推荐" th:field="*{message.isRecommend}">
				<input type="radio" name="isRecommend" value="1" title="不推荐" th:field="*{message.isRecommend}">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">内容描述</label>
			<div class="layui-input-block">
				<textarea placeholder="请输入描述" class="layui-textarea" name="description" th:text="${message.description}" ></textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">展示图片</label>
			<div class="layui-upload-drag layui-input-inline" id="upload">
				<i class="layui-icon"></i>
				<p>点击上传，或将文件拖拽到此处</p>
			</div>
			<div class="layui-input-inline" id="imgBox">
				<img th:src="${message.imgUrl}">
				<input type="hidden" name='imgUrl' class='imgUrl' th:value="${message.imgUrl}">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">文章内容</label>
			<div class="layui-input-block">
				<textarea placeholder="请输入内容" class="layui-textarea" name="content" id="content"></textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="addLinks">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		</div>
	</form>
	<script type="text/javascript" src="/layui/layui.js"></script>
    <script type="text/javascript" src="/js/index.js"></script>
	<script type="text/javascript" src="/js/jquery-1.11.0.min.js"></script>
</body>
<script th:inline="javascript">
    /*<![CDATA[*/
    var content = [[${message.content}]];
    /*]]>*/
    KindEditor.ready(function(K) {
        window.editor = K.create('#content',{
            uploadJson : '/kind/uploadFile',
            width : '100%',
			height : '300px'
        });
        editor.html(content);
    });
</script>
<script type="text/javascript" src="/js/page/articleAdd.js"></script>
</html>